package com.example.myapplication.tack_18;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.example.myapplication.R;
import com.example.myapplication.tack_13.PatientActivity;

public class InspectionActivity extends AppCompatActivity {
    private ImageView exit;
    private LinearLayout line1;
    private LinearLayout line2;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tack_18_activity_inspection);
        init();
        exit_();
        line1_();
        line2_();
    }

    private void line1_() {
        line1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(InspectionActivity.this,ManageActivity.class);
                InspectionActivity.this.startActivity(intent);
            }
        });
    }
    private void line2_() {
        line2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(InspectionActivity.this,ReservationActivity.class);
                InspectionActivity.this.startActivity(intent);
            }
        });
    }


    private void exit_() {
        exit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                InspectionActivity.this.finish();
            }
        });
    }

    private void init() {
        exit =findViewById(R.id.exit);
        line1 =findViewById(R.id.line1);
        line2 =findViewById(R.id.line2);
        AlertDialog.Builder builder = new AlertDialog.Builder(InspectionActivity.this);
        View view = getLayoutInflater().inflate(R.layout.tack_18_hdxz,null);
        builder.setView(view);
        increase(view,builder);
    }

    private void increase(View view, AlertDialog.Builder builder) {
        builder.setNegativeButton("阅读并同意", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {

            }
        });
        AlertDialog alertDialog = builder.create();
        alertDialog.show();
        Button positiveButton = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
        // 设置按钮的背景颜色为白色
        positiveButton.setBackgroundColor(Color.WHITE);

        positiveButton.setTextColor(Color.BLACK); // 设置"确定"按钮的颜色

    }

}